import os
from shutil import rmtree

for root, dirs, files in os.walk('E:/Django-1.10.1'):
    if root.endswith('\locale'):
        for i in dirs:
            if i != 'en' and i != 'zh_Hans' and i != 'xxx':
                p = os.path.join(root, i)
                print p
                rmtree(p)
